import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Center(
          child: Text(
            "appbar",
            textDirection: TextDirection.ltr,
            style: TextStyle(
                fontSize: 10, color: Colors.green, fontWeight: FontWeight.bold),
          ),
        ),
        backgroundColor: Colors.deepPurpleAccent,
      ),
      body: Hoempae(),
      floatingActionButton: FloatingActionButton(
          child: Icon(Icons.add),
          onPressed: () {
            print("floatbtn.jk...");
          }),
    ),
  ));
}

class Hoempae extends StatefulWidget {
  const Hoempae({Key? key}) : super(key: key);

  @override
  _HoempaeState createState() => _HoempaeState();
}

class _HoempaeState extends State<Hoempae> {
  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        FlatButton(
          onPressed: () {
            print("fds");
          },
          child: Text("dfas"),
          color: Colors.red,
          //默认情况下Button上下有一定的间距
          //
          materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,//紧缩的通过设置该属性做到缩小间距
        ),
        FlatButton(
          materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
          onPressed: () {
            print("fds");
          },
          child: Text("dfas"),
          color: Colors.red,
        ),
        FadeInImage(placeholder:AssetImage("assets/image/img.png"),
          image: NetworkImage("http://180.76.138.108/images/xingkong10.jpg"),
        )
      ],
    );
  }
}
